package com.dylan.springcloud.ribbonloadbalancer;

import com.dylan.springcloud.ribbonloadbalancer.config.LoadBalancerConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Created by Dylan on 2018/10/13.
 */
@SpringBootApplication
@EnableDiscoveryClient
public class Ch51LoadBalancerApplication {

    public static void main(String[] args) {
        SpringApplication.run(Ch51LoadBalancerApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
